/**
 * ShowComponent.cpp
 * Coyright (c) 2009 Xiaofeng Gu. All Rights Reserved.
 * Author : Xiaofeng Gu
 *
 * Creation Data : 2009/06/21
 */

#include "stdafx.h"
#include "ShowComponent.h"
#include "Global.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

HRESULT CShowComponent::OnExecute()
{
	HRESULT hr = S_OK;
	hr = __super::OnExecute();
	if (hr != S_OK)
	{
		return hr;
	}

	CSKInfo* pSKInfo = CSKGlobal::GetTargetDoc()->GetSKInfo();
	CFamily* pFamily = pSKInfo->GetFamily();
	CComponent* pComponent = pFamily->GetActiveChild();

	CSKGlobal::GetGraphicsManager()->Clear();
	CSKGlobal::GetGraphicsManager()->Add(pComponent);
	CSKGlobal::GetMainView()->UpdateView();

	return S_OK;
}